<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
    <title>Container</title>
    <!--    Bootstrap核心css文件-->
    <link rel="stylesheet" href="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/css/bootstrap.min.css">

</head>
<body class="container">
<h2 class="mb-4">定义折叠</h2>
<p>
    <a href="#collapse" class="btn btn-primary" data-toggle="collapse">&lt;a&gt;触发折叠</a>
    <button class="btn btn-danger" type="button" data-toggle="collapse" data-target="#collapse1">&lt;button&gt;触发折叠</button>
</p>
<div class="collapsing" id="collapse">
    <div class="card card-body">
        这是&lt;a&gt;触发的折叠内容
    </div>
</div>
<div class="collapsing" id="collapse1">
    <div class="card card-body">
        这是&lt;button&gt;触发的折叠内容
    </div>
</div>

<!--引入js文件-->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<!--Bootstrap核心JavaScript文件-->
<script src="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
</body>
</html>